//
// Created by alexa on 5/13/2024.
//

#ifndef ARTILLERYSYSTEM_MISSILEREPOSITORY_H
#define ARTILLERYSYSTEM_MISSILEREPOSITORY_H


#include "../../entities/missile/Missile.h"
#include "../../entities/_identifiable/IdentifiableList.h"

using namespace std;

class MissileRepository {
private:
    IdentifiableList<Missile> source;

    string fileSourcePath;
public:
    virtual ~MissileRepository();

    explicit MissileRepository(const string &fileSourcePath = "missiles.json");

    const string &getFileSourcePath() const;

    void setFileSourcePath(const string &fileSourcePath);

    void loadDataFromFile();

    void saveDataToFile();

    Missile *findById(string id);

    void save(Missile *missile);

    void deleteOne(Missile *missile);

    vector<Missile *> findAll();
};


#endif //ARTILLERYSYSTEM_MISSILEREPOSITORY_H
